home *** CD-ROM | disk | FTP | other *** search
- /* Example program to detect and report hardware */
-
- #include <graphics.h>
-
- main()
- {
- int errorcode;
- int graphdriver;
- int graphmode;
- /* Call detectgraph to determine hardware */
- detectgraph(&graphdriver, &graphmode);
- if (graphdriver < 0)
- {
- printf("No graphics hardware available!\n");
- exit(1);
- }
- /* Report detected hardware */
- printf("'detectgraph()' reports: ");
- switch (graphdriver)
- {
- case CGA: printf("Color Graphics Adapter");
- break;
- case MCGA: printf("Multicolor Graphics Array");
- break;
- case EGA:
- case EGA64:
- case EGAMONO: printf("Enhanced Graphics Adapter");
- break;
- case HERCMONO: printf("Hercules Color Card");
- break;
- case ATT400: printf("AT&T 640x400 card");
- break;
- case VGA: printf("Video Graphics Array or IBM 8514");
- break;
- case PC3270: printf("IBM PC 3270");
- break;
- }
- printf("\n");
- }